/**
 * Created by Administrator on 2017/8/14.
 */

import React ,{Component} from 'react'
import {
    Text,InteractionManager,Image
} from 'react-native'
import {connect} from "react-redux"
import * as Actions from "./Actions/zhihu"

 class infoPage extends Component{


    constructor(props) {
        super(props)
    }

     componentWillMount() {
         this.fetchLatest();
     }

     fetchLatest = ()=> {
         InteractionManager.runAfterInteractions(() => {
             const {dispatch} = this.props;
             dispatch(Actions.startRefreshZhihu());
         });
     }

    render(){

        console.log('sssss:'+JSON.stringify(this.props))
        // const {zhihu} = this.props;
        // if (zhihu === undefined || !zhihu.loaded || zhihu.db.length === 0) {
        //     return (
        //         <Image
        //             source={require('./loading.gif')}
        //             style={{width: 70, height: 70}}
        //         />
        //     );
        // }
        return(
            <Text>操你妈逼</Text>
        )
    }
}

function mapStateToProps(state) {
    const {zhihu} = state;
    return {
        zhihu
    };
}
export default connect(mapStateToProps)(infoPage)